<template>
  <div>
    <van-nav-bar title="我的" />

    <!-- {{ session_info }} -->

    <van-image
      width="100"
      height="100"
      :src="`/dev-api/web/image?model=res.partner&field=image_128&id=${session_info.partner_id}`"
    />

    <van-cell-group title="个人信息" inset>
      <van-cell title="名称" :value="session_info.name" />
    </van-cell-group>
    <van-cell-group title="服务器" inset>
      <van-cell title="数据库" :value="session_info.db" />
      <van-cell title="版本" :value="session_info.server_version" />
    </van-cell-group>

    <van-cell-group title=" ">
      <van-button type="primary" block @click="onLogout">注销再登录</van-button>
    </van-cell-group>
  </div>
</template>

<script>
import api from '@/odooapi'

export default {
  name: 'Home',
  components: {},
  mixins: [],

  data() {
    return {}
  },
  computed: {
    session_info() {
      return api.web.session.session_info || {}
    }
  },
  async created() {},

  methods: {
    async onLogout() {
      await api.web.logout()
      this.$router.replace({ path: '/user/login' })
    }
  }
}
</script>

<style type="text/css"></style>
